<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

<!-- ========================= -->
<!-- root element: proFormaInvoice -->
<!-- ========================= -->

<xsl:template match="proFormaInvoice">

	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

	<fo:layout-master-set>
		<fo:simple-page-master master-name="simpleA4"
        		page-height="11in"
        		page-width="8.5in"
        		margin-top="20mm"
        		margin-bottom="20mm"
      			margin-left="10mm"
      			margin-right="10mm" >

			<fo:region-after extent="3mm"/>

			<fo:region-body />

  		</fo:simple-page-master>
	</fo:layout-master-set>

<fo:page-sequence master-reference="simpleA4">

<!--============================== -->
<!-- Page Number block             -->
<!--============================== -->

<fo:static-content flow-name="xsl-region-after">
	<fo:block font-size="7pt" font-weight="bold" text-align="right">
        Page <fo:page-number />
	
	 of
	<fo:page-number-citation ref-id="endofdoc"/>

        </fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">

<!--==============================-->
<!-- Logo and Self address block  -->
<!--==============================-->

	<fo:block font-size="8pt" space-after="1cm">
	<fo:table table-layout="fixed" width="100%" >

	<fo:table-column column-width="10mm" />
	<fo:table-column column-width="35mm"/>
	<fo:table-column column-width="20mm" />
	<fo:table-column display-align="center" />
	<fo:table-column />

	<fo:table-body>
		<fo:table-row>
			<fo:table-cell />

			<fo:table-cell>
			
			<xsl:apply-template match="logo">
				<fo:external-graphic content-height = ".5in"  content-width = ".5in" >
					<xsl:attribute name="src" >
						<xsl:value-of select="logo" />
					</xsl:attribute>
				</fo:external-graphic>
			</xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />

		     	<fo:table-cell text-align="center" width="100%">
		     		<fo:block font-size="12pt" font-weight="bold" display-align="center">Pro Forma Invoice</fo:block>
		     		<xsl:apply-template match="selfAddress">
			  	<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//name" /></fo:block>
				<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address1" /></fo:block>
				<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address2" /></fo:block>
			  	<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address3" /></fo:block>
			  	<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address4" /></fo:block>
				<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//cityStateZip" /></fo:block>
				<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//phoneFax" /></fo:block>
			  	</xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />
		</fo:table-row>
	</fo:table-body>
	</fo:table >
	</fo:block>

<!--==============================-->
<!-- From and To addresses block  -->
<!--==============================-->


	<fo:table table-layout="fixed" width="100%" space-after="0.5cm">
		
		<fo:table-column />
		<fo:table-column column-width="2mm"/>
		<fo:table-column column-width="64mm"/>
		<fo:table-column column-width="2mm"/>
		<fo:table-column />
		
		<fo:table-body>
			<fo:table-row>
				
				<fo:table-cell hyphenate="true" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="billToAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

                <fo:table-cell/>

                <fo:table-cell/>

				<fo:table-cell hyphenate="true" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="shipToAddress"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>


<!--===============================-->
<!-- Information block             -->
<!--===============================-->


	<fo:block font-size="8pt" space-after="0.5cm">
		<xsl:apply-templates select="information"/>
	</fo:block>


<!--=============================== -->
<!-- Line Items details block      -->
<!--=============================== -->

	<fo:block font-size="8pt" space-after="0.5cm">
	        <xsl:apply-templates select="lineItems"/>
        </fo:block>


<!--=============================== -->
<!-- Bank Information details block      -->
<!--=============================== -->

	<fo:table table-layout="fixed" width="100%" space-after="1cm">
		<fo:table-column  column-width="30mm"/>
		<fo:table-column  column-width="30mm"/>
		<fo:table-column  column-width="32mm"/>

		<fo:table-body>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="8pt" > <xsl:apply-templates select="bankInformation"/> </fo:block>					
				</fo:table-cell>

				<fo:table-cell />
				<fo:table-cell>
					<fo:block font-size="8pt" > <xsl:apply-templates select="total"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="salesTax"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="freight"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="misc"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="balanceDue"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>

    <fo:table width="100%" table-layout="fixed">
	       <fo:table-column column-width="20mm" />
           <fo:table-column column-width="60mm" />
           <fo:table-column column-width="6mm" />
           <fo:table-column column-width="10mm" />
           <fo:table-column column-width="24mm" />

	       <fo:table-body>
	       <fo:table-row>

	       <fo:table-cell display-align="center">
		       <fo:block text-align="center" font-size="7pt" font-weight="bold" >
				Signature:
         	    </fo:block>
           </fo:table-cell>
           <fo:table-cell display-align="center">
		       <fo:block>
		       <fo:leader leader-pattern="rule" leader-length="3.5in" rule-thickness="1pt" color="black" />
	               </fo:block>
            </fo:table-cell>
               <fo:table-cell display-align="center">
                   <fo:block text-align="center" font-size="7pt" font-weight="bold" >
                   </fo:block>
               </fo:table-cell>

           <fo:table-cell display-align="center">
		       <fo:block text-align="center" font-size="7pt" font-weight="bold" >
		                Date:
	               </fo:block>
	       </fo:table-cell>
           <fo:table-cell display-align="center">
		       <fo:block>
		       <fo:leader leader-pattern="rule" leader-length="1in" rule-thickness="1pt" color="black" />
	               </fo:block>
            </fo:table-cell>
	       </fo:table-row>
         </fo:table-body>
       </fo:table>

<!--=============================== -->
<!-- PAGE COUNT BLOCK   -->
<!--=============================== -->

<fo:block id="endofdoc"></fo:block>
</fo:flow>

</fo:page-sequence>
</fo:root>
</xsl:template>

<!-- ================================ -->
<!--	child element: Self Address     -->
<!-- ================================ -->

<xsl:template match="selfAddress">
	<fo:table width="100%" table-layout="fixed">
	<fo:table-column />
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell text-align="center">

					<fo:block font-weight="bold">Self Address:</fo:block>
					<fo:block><xsl:value-of select="name"/></fo:block>
					<fo:block><xsl:value-of select="address1"/></fo:block>
					<fo:block><xsl:value-of select="address2"/></fo:block>
					<fo:block><xsl:value-of select="address3"/></fo:block>
					<fo:block><xsl:value-of select="phone"/></fo:block>
					<fo:block><xsl:value-of select="fax"/></fo:block>
					<fo:block>Email: <xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- ================================ -->
<!--  Child element: Bill To Address  -->
<!-- ================================ -->

<xsl:template match="billToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Bill To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

				    <fo:block><xsl:value-of select="name"/></fo:block>
				    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
				    <fo:block><xsl:value-of select="address1"/></fo:block>
				    <fo:block><xsl:value-of select="address2"/></fo:block>
				    <fo:block><xsl:value-of select="address3"/></fo:block>
				    <fo:block><xsl:value-of select="address4"/></fo:block>
				    <fo:block><xsl:value-of select="city"/></fo:block>
				    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
				    <fo:block><xsl:value-of select="phone"/></fo:block>
				    <fo:block><xsl:value-of select="cell"/></fo:block>
				    <fo:block><xsl:value-of select="fax"/></fo:block>
				    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	Child element: Ship To Address   -->
<!-- =================================== -->

<xsl:template match="shipToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Ship To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

				    <fo:block><xsl:value-of select="name"/></fo:block>
				    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
				    <fo:block><xsl:value-of select="address1"/></fo:block>
				    <fo:block><xsl:value-of select="address2"/></fo:block>
				    <fo:block><xsl:value-of select="address3"/></fo:block>
				    <fo:block><xsl:value-of select="address4"/></fo:block>
				    <fo:block><xsl:value-of select="city"/></fo:block>
				    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
				    <fo:block><xsl:value-of select="phone"/></fo:block>
				    <fo:block><xsl:value-of select="cell"/></fo:block>
				    <fo:block><xsl:value-of select="fax"/></fo:block>
				    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Information       -->
<!-- =================================== -->

<xsl:template match="information">
	<fo:block font-size="7pt">
	<fo:table width="100%" table-layout="fixed">
		<fo:table-column />
		<fo:table-column column-width="2mm"/>
		<fo:table-column column-width="64mm"/>
		<fo:table-column column-width="2mm"/>
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.5cm" >

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />
				
				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Sales Order#</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Order Date</fo:block>
						</fo:table-cell>
						
					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="salesOrder"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="orderDate"/>
							</fo:block>
						</fo:table-cell>
						
					</fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Invoice #</fo:block>
						 </fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Invoice Date</fo:block>
						</fo:table-cell>
					</fo:table-row>

					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="invoiceNo"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="invoiceDate"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Sales Person</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Regional Rep</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Del Terms</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Pay Terms</fo:block>
						</fo:table-cell>
					</fo:table-row>

					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="salesPerson"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="customerPO"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="delTerms"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="payTerms"/>
							</fo:block>
						</fo:table-cell>

					</fo:table-row>

				</fo:table-body>
			</fo:table>
		</fo:table-cell>
	</fo:table-row>

	</fo:table-body>
	</fo:table>
        </fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: LineItems. 	 -->
<!-- =================================== -->

<xsl:template match="lineItems">
	<fo:block font-size="7pt">
        <fo:table margin="2mm" width="100%" table-layout="fixed">
		    <fo:table-column column-width="10mm"/>		    
	        <fo:table-column column-width="4mm"/>
 		    <fo:table-column column-width="31mm"/>
	        <fo:table-column column-width="14mm"/>
	        <fo:table-column column-width="24mm"/>
	        <fo:table-column column-width="13mm"/>
		    <fo:table-column column-width="13mm"/>
	        <fo:table-column column-width="13mm"/>
		    <fo:table-column column-width="10mm"/>
            <fo:table-column column-width="13mm"/>
            <fo:table-column column-width="21mm"/>
	        <fo:table-column column-width="30mm"/>

            <fo:table-body>
			<fo:table-row height="0.6cm" background-color="#DEE1E2">
				<fo:table-cell border="1pt double black" display-align="center" >
			    		<fo:block font-weight="bold" text-align="center">PO Line#</fo:block>
	  			</fo:table-cell>

	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">UM</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelMfgPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelCustPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Product Description</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Requested Dock Date</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Scheduled Ship Date</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Revised Ship Date</fo:block>
				</fo:table-cell>
       				<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Taxable</fo:block>				
				</fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Ship Qty</fo:block>
	  			</fo:table-cell>
                       <fo:table-cell border="1pt double black" display-align="center">
				<fo:block font-weight="bold" text-align="center">Unit Price</fo:block>
				</fo:table-cell>
	       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Extended Price</fo:block>
				</fo:table-cell>
			</fo:table-row>
            <xsl:for-each select="/proFormaInvoice/lineItems">
            <xsl:for-each select="lineItem">
                <fo:table-row height="0.4cm" background-color="#FFFFEE">
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="poLineItem"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" >
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="um"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="mfgPartNumber"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="customerPartNumber"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                        <fo:block font-weight="bold" text-align="left">
                        <xsl:value-of select="description"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="requestDate"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="scheduleDate"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="revisedShipDate"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="taxable"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center">
                        <fo:block font-weight="bold" text-align="center">
                        <xsl:value-of select="reqQty"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                        <fo:block font-weight="bold" text-align="right">
                        <xsl:value-of select="unitPrice"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true">
                        <fo:block font-weight="bold" text-align="right" >
                        <xsl:value-of select="extendedPrice"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
                </xsl:for-each>
                <!--
                <fo:table-row height="0.4cm" background-color="#FFFFFF">
                    <fo:table-cell number-columns-spanned="1" border="1pt double black" display-align="center" >
                        <fo:block font-weight="bold" text-align="right">Sub Total</fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" background-color="#FFFFEE">
                        <fo:block font-weight="bold" text-align="center"><xsl:value-of select="subTotalQty"/></fo:block>
                    </fo:table-cell>
                    <fo:table-cell number-columns-spanned="9" border="1pt double black" display-align="center" >
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" background-color="#FFFFEE">
                        <fo:block font-weight="bold" text-align="right"><xsl:value-of select="subTotalAmt"/></fo:block>
                    </fo:table-cell>		    
                </fo:table-row>
                -->
                </xsl:for-each>
		</fo:table-body>
	</fo:table>
    </fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: Bank Information  -->
<!-- =================================== -->

<xsl:template match="bankInformation">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Banking Information :</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="0.5cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block><xsl:value-of select="bankName"/></fo:block>
					<fo:block><xsl:value-of select="address1"/></fo:block>
					<fo:block><xsl:value-of select="address2"/></fo:block>
					<fo:block><xsl:value-of select="address3"/></fo:block>
					<fo:block><xsl:value-of select="address4"/></fo:block>
					<fo:block><xsl:value-of select="city"/></fo:block>
					<fo:block><xsl:value-of select="state"/></fo:block>
					<fo:block><xsl:value-of select="zipcode"/></fo:block>
					<fo:block><xsl:value-of select="country"/></fo:block>
					<fo:block><xsl:value-of select="aba"/></fo:block>
					<fo:block><xsl:value-of select="account"/></fo:block>
					<fo:block><xsl:value-of select="swiftcode"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Total      -->
<!-- =================================== -->

<xsl:template match="total">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold"  border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Total</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/proFormaInvoice/total"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Sales Tax      -->
<!-- =================================== -->

<xsl:template match="salesTax">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Sales Tax</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/proFormaInvoice/salesTax"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Freight      -->
<!-- =================================== -->

<xsl:template match="freight">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Freight</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/proFormaInvoice/freight"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Misc      -->
<!-- =================================== -->

<xsl:template match="misc">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold" ><xsl:value-of select="/proFormaInvoice/misc/@name"/></fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/proFormaInvoice/misc"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Balance Due      -->
<!-- =================================== -->

<xsl:template match="balanceDue">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Balance Due</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/proFormaInvoice/balanceDue"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	END of Document		         -->
<!-- =================================== -->

</xsl:stylesheet>